using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace HareGame
{
    [CustomEditor(typeof(PointManager))]
    public class PointEditor : Editor
    {
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            PointManager component = (PointManager)target;
            foreach (var v in component.Nodes)
            {
                v.transform.localScale = Vector3.one * component.Size;
                if (v.GetComponent<Renderer>().sharedMaterial == null)
                {
                    v.GetComponent<Renderer>().sharedMaterial = Resources.Load<Material>("PointNode");
                }
                v.GetComponent<Renderer>().sharedMaterial.color = component.Color;
            }
        }
    }
}